<?php

error_reporting(7);

if (!$_GET['action']) {
	$template_name = "index.htm";
	require "common.php";
	$tpl->output();
}

if ($_GET['action'] == "menu") {
	$template_name = "menu.htm";
	require "common.php";
	$tpl->output();
}

if ($_GET[action]=="main") {
	$template_name = "main.htm";
	require "common.php";
	$tpl->output();
	require "footer.php";
}

if ($_GET[action]=="top") {
	$template_name = "top.htm";
	require "common.php";
	$tpl->output();
}

if ($_GET[action]=="logout") {
	require "common.php";
	unset($_SESSION['isadmin']);
	unset($_SESSION['admininfo']);
	$_SESSION = array();
	unset($_SESSION);
	redirect("./", "你已成功退出登陆，现即将返回！");
}

if ($_GET['action'] == "phpinfo") {
	require "common.php";
	echo "<p>";
	echo "当前时间: ".date("Y-m-d H:i:s");
	echo "</p>";
	phpinfo();
	exit;
}

if ($_GET['action'] == 'view_system_top') {
	require "common.php";
	$output = system("top");
	echo "<pre>";
	echo $output;
	echo "</pre>";
}

?>